alter table jms_dm.dm_mng_thd_flase_send_upload_batch_mid_dt
    set tblproperties ('external.table.purge' = 'true');
drop table jms_dm.dm_mng_thd_flase_send_upload_batch_mid_dt;
CREATE EXTERNAL TABLE jms_dm.dm_mng_thd_flase_send_upload_batch_mid_dt
(

    bill_no          string comment '运单号',
    upload_batch     string comment '批次号',
    platform         string comment '平台',
    create_time      string comment '手工上传时间',
    input_time       string comment '运单录入时间',
    ordersource_code string comment '订单来源',
    ordersource_name string comment '订单来源',
    update_time      string comment '更新时间'
) COMMENT '春节不打烊-桃花岛虚假发货批次上传单'
    PARTITIONED BY (
        dt string COMMENT 't-1')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_mng_thd_flase_send_upload_batch_mid_dt'
;

CREATE EXTERNAL TABLE jms_dm.dm_mng_thd_flase_send_upload_batch_dt
(
    waybill_no              string comment '运单号',
    input_time              string comment '运单录入时间',
    date_time               string comment '运单录入日期',
    first_duty_network_code string comment '首责任机构code',
    first_duty_network_name string comment '首责任机构name',
    first_duty_network_type int comment '首责任机构网点类型',
    first_duty_agent_code   string comment '首责任机构代理区code',
    first_duty_agent_name   string comment '首责任机构代理区name',
    first_duty_type         string comment '首责任类型',
    first_duty_standard     string comment '首责任标准',
    first_network_scantime  string comment '首机构操作时间	',
    first_network_code      string comment '首机构操作网点',
    first_network_name      string comment '首机构操作网点name',
    first_agent_code        string comment '始发代理区',
    first_agent_name        string comment '始发代理区name',
    first_city_id           string comment '始发城市id',
    first_city_desc         string comment '始发城市name',
    first_province_id       string comment '始发省份id',
    first_province_desc     string comment '始发省份name',
    end_network_code        string comment '目的网点',
    end_network_name        string comment '目的网点',
    end_agent_code          string comment '目的代理区',
    end_agent_name          string comment '目的代理区',
    end_city_id             string comment '目的城市id',
    end_city_desc           string comment '目的城市name',
    end_province_id         string comment '目的省份id',
    end_province_desc       string comment '目的省份name',
    track_link              string comment '链路环节',
    all_duty_network_code   string comment '责任机构',
    all_duty_network_name   string comment '责任机构',
    duration                string comment '时长',
    out_network_code        string comment '出仓网点',
    out_network_name        string comment '出仓网点',
    out_city_id             string comment '出仓城市id',
    out_city_desc           string comment '出仓城市name',
    out_province_id         string comment '出仓省份id',
    out_province_desc       string comment '出仓省份name',
    sign_time               string comment '签收时间',
    all_duty_standard       string comment '任标准',
    all_duty_type           string comment '责任类型',
    all_trace_falg          string comment '问题环节',
    track_link_code         string comment '链路环节code',
    batch_no                string comment '批次号',
    is_manual               string comment '是否手工上传',
    update_time             string comment '更新时间'
) COMMENT '春节不打烊-桃花岛虚假发货批次上传'
    PARTITIONED BY (
        dt string COMMENT '录入时间')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_mng_thd_flase_send_upload_batch_dt'
;